library ClearScreenCommand initializer init requires LegacySystem

	private function ClearScreenCommand takes nothing returns boolean
		local player p = GetTriggerPlayer()
		if ( p== GetLocalPlayer() ) then
			call ClearTextMessages()
		endif
		set p = null
		return false
	endfunction

	private function init takes nothing returns nothing
		local trigger t
		local integer i = 0
		set t = CreateTrigger()
		loop
			exitwhen i > 11
			call TriggerRegisterPlayerChatEvent(t, Player(i), "-clear", true)
			set i = i + 1
		endloop
		call TriggerAddCondition(t, Condition(function ClearScreenCommand))
	endfunction
endlibrary